package com.vagavaga.tcpt;

import java.io.IOException;
import java.net.ServerSocket;

/**
 * ITransportServer is central class of TCTP framework. It is used for
 * establishing either "Server Use" scenario, or "Client Use" scenario.
 * <p>
 * 
 * 
 * @author river
 * 
 */
public interface ITransportServer {
    void stop() throws IOException;

    ServerSocket listen(int port) throws IOException;

    IConnection connect(String host, int port, Object attachment) throws IOException;

    IConnection connect(String host, int port) throws IOException;

    void addConnectionListener(IConnectionListener l);

    void removeConnectionListener(IConnectionListener l);
}
